import objectUtils from "@/utils/object/index.js";

export default objectUtils.freeze({
	create: function(length){
		function S4() {
		    let num = 1 + Math.random()
		    return ((num * 0x10000) | 0).toString(16).substring(1);
		}
		let uuidStr = ""
		let len = (length && (length % 4 !== 0)) ? (length / 4) : 8
		for (let i = 0; i < len; i++) {
		    uuidStr += S4()
		}
		return uuidStr
	}
});